﻿using System;
using System.Collections;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Xml.Linq;

namespace Jy123.Web.Friend
{
    /// <summary>
    /// $codebehindclassname$ 的摘要说明
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    public class UpdateFriendClass : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            string cID = context.Request["CID"];
            string cName = context.Request["CName"];
            bool update = UpdateSuccess(cID, cName);
            context.Response.ContentType = "application/json";
            context.Response.Write(update);
        }
        private bool UpdateSuccess(string cID,string cName)
        {
            bool upDate = false;
            if (!string.IsNullOrEmpty(cID) & !string.IsNullOrEmpty(cName))
            {
                Jy123.Model.User_FriendClass modelFrdClass = new Jy123.Model.User_FriendClass();
                Jy123.BLL.User_FriendClass bllFrdClass = new Jy123.BLL.User_FriendClass();
                modelFrdClass = bllFrdClass.GetModel(Convert.ToInt32(cID));
                modelFrdClass.CName = cName;
                bllFrdClass.Update(modelFrdClass);
                upDate = true;
            }
            return upDate;
        }
        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}
